/*
 * $Id: StdAfx.h 7 2002-07-24 18:16:48Z bpruessmann $
 * 
 * Copyright (c) 2001 Boris Pruessmann and others.
 * All rights reserved.   This program and the accompanying materials
 * are made available under the terms of the Common Public License v0.5
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/cpl-v05.html
 * 
 * Contributors:
 *    Boris Pruessmann - Initial implementation.
 */
#include "net_sourceforge_perforce_api_internal_ClientApi.h"
#include "net_sourceforge_perforce_api_internal_ClientUser.h"
#include "net_sourceforge_perforce_api_internal_Error.h"
#include "net_sourceforge_perforce_api_internal_Spec.h"
#include "net_sourceforge_perforce_api_internal_SpecData.h"
#include "clientapi.h"
#include "spec.h"

inline void setNativeHandle(JNIEnv* env, jobject object, void* handle)
{
	jclass objectClass = env->GetObjectClass(object);
	jfieldID nativeHandle = env->GetFieldID(objectClass, "_nativeHandle", "I");
	env->SetIntField(object, nativeHandle, (jint)handle);
}


inline void* getNativeHandle(JNIEnv* env, jobject object)
{
	jclass objectClass = env->GetObjectClass(object);
	jfieldID nativeHandle = env->GetFieldID(objectClass, "_nativeHandle", "I");

	return (void*)env->GetIntField(object, nativeHandle);
}
